<?php
class Feedback extends CS_Controller
{
    private $type = array(
        '1'=>'使用不畅',
        '2'=>'缺少内容',
        '3'=>'宝贵建议',
    );
    public function _init()
    {
        $this->load->library('pagination');
        $this->load->model('user_feedback_model','user_feedback');
    }
    
    public function grid($pg=1)
    {
        $getData = $this->input->get();
        $getData['provider_id'] = $this->uid;
        $page_num = 15;
        $num = ($pg - 1) * $page_num;
        $config['first_url'] = base_url('feedback/grid') . $this->pageGetParam($this->input->get());
        $config['suffix'] = $this->pageGetParam($this->input->get());
        $config['base_url'] = base_url('feedback/grid');
        $config['total_rows'] = $this->user_feedback->findByCount($getData);
        $config['uri_segment'] = 3;
        $this->pagination->initialize($config);
        $data['pg_link'] = $this->pagination->create_links();
        $data['page_list'] = $this->user_feedback->page_list($page_num, $num, $getData);
        $data['all_rows'] = $config['total_rows'];
        $data['pg_now'] = $pg;
        $data['pg_num'] = $page_num;
        $data['type'] = $this->type;
        $this->load->view('userfeedback/grid', $data);
    }
}